package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SystemDictDataMapper;
import com.ruoyi.system.domain.SystemDictData;
import com.ruoyi.system.service.ISystemDictDataService;

/**
 * 字典数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class SystemDictDataServiceImpl implements ISystemDictDataService 
{
    @Autowired
    private SystemDictDataMapper systemDictDataMapper;

    /**
     * 查询字典数据
     * 
     * @param id 字典数据主键
     * @return 字典数据
     */
    @Override
    public SystemDictData selectSystemDictDataById(Long id)
    {
        return systemDictDataMapper.selectSystemDictDataById(id);
    }

    /**
     * 查询字典数据列表
     * 
     * @param systemDictData 字典数据
     * @return 字典数据
     */
    @Override
    public List<SystemDictData> selectSystemDictDataList(SystemDictData systemDictData)
    {
        return systemDictDataMapper.selectSystemDictDataList(systemDictData);
    }

    /**
     * 新增字典数据
     * 
     * @param systemDictData 字典数据
     * @return 结果
     */
    @Override
    public int insertSystemDictData(SystemDictData systemDictData)
    {
        systemDictData.setCreateTime(DateUtils.getNowDate());
        return systemDictDataMapper.insertSystemDictData(systemDictData);
    }

    /**
     * 修改字典数据
     * 
     * @param systemDictData 字典数据
     * @return 结果
     */
    @Override
    public int updateSystemDictData(SystemDictData systemDictData)
    {
        systemDictData.setUpdateTime(DateUtils.getNowDate());
        return systemDictDataMapper.updateSystemDictData(systemDictData);
    }

    /**
     * 批量删除字典数据
     * 
     * @param ids 需要删除的字典数据主键
     * @return 结果
     */
    @Override
    public int deleteSystemDictDataByIds(Long[] ids)
    {
        return systemDictDataMapper.deleteSystemDictDataByIds(ids);
    }

    /**
     * 删除字典数据信息
     * 
     * @param id 字典数据主键
     * @return 结果
     */
    @Override
    public int deleteSystemDictDataById(Long id)
    {
        return systemDictDataMapper.deleteSystemDictDataById(id);
    }
}
